package Sequence;

public class Test0509 {
}

class Solution0509_1 {
    public int fib(int n) {
        if (n==0) return 0;

        int pre = 0, ans = 1;
        for (int i = 1; i < n; i++) {
            int temp = pre + ans;
            pre = ans;
            ans = temp;
        }

        return ans;
    }
}
